/*
 * Copyright (c) 2023 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#include "preset_type_descriptors.h"
namespace OHOS {
namespace UDMF {
constexpr const char *REFERENCE_URL = "https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/"\
                                      "apis/js-apis-data-uniformTypeDescriptor.md#uniformdatatype";

PresetTypeDescriptors::PresetTypeDescriptors()
{
    InitDescriptors();
}

PresetTypeDescriptors::~PresetTypeDescriptors()
{
}

PresetTypeDescriptors &PresetTypeDescriptors::GetInstance()
{
    static auto instance = new PresetTypeDescriptors();
    return *instance;
}

std::vector<TypeDescriptorCfg> &PresetTypeDescriptors::GetPresetTypes()
{
    return typeDescriptors_;
}

void PresetTypeDescriptors::InitDescriptors()
{
    typeDescriptors_ = {
        {"general.entity",
         {},
         {},
         {},
         "Base type for physical hierarchy.",
         REFERENCE_URL,
         ""},
        {"general.object",
         {},
         {},
         {},
         "Base type for logical hierarchy.",
         REFERENCE_URL,
         ""},
        {"general.file",
         {"general.entity"},
         {},
         {},
         "Base type for file.",
         REFERENCE_URL,
         ""},
        {"general.directory",
         {"general.entity"},
         {},
         {},
         "Base type for directory.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_folder"},
        {"general.folder",
         {"general.directory"},
         {},
         {},
         "Base type for folder.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_folder"},
        {"general.symlink",
         {"general.entity"},
         {},
         {},
         "Base type for symlink.",
         REFERENCE_URL,
         ""},
        {"general.composite-object",
         {"general.object"},
         {},
         {},
         "Base type for mixed object. For example, a PDF file contains both text and special formatting data.",
         REFERENCE_URL,
         ""},
        {"general.media",
         {"general.object"},
         {},
         {},
         "Base type for media.",
         REFERENCE_URL,
         ""},
        {"general.image",
         {"general.media"},
         {},
         {},
         "Base type for images.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_image"},
        {"general.png",
         {"general.image"},
         {".png"},
         {"image/png"},
         "PNG image.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_image"},
        {"general.jpeg",
         {"general.image"},
         {".jpg", ".jpeg"},
         {"image/jpeg"},
         "JPEG image.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_image"},
        {"general.tiff",
         {"general.image"},
         {".tif", ".tiff"},
         {"image/tiff"},
         "TIFF image.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_image"},
        {"general.raw-image",
         {"general.image"},
         {},
         {},
         "Base type for digital camera raw image formats.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_image"},
        {"general.video",
         {"general.media"},
         {},
         {},
         "Base type for video.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_video"},
        {"general.avi",
         {"general.video"},
         {".avi", ".vfw"},
         {"video/avi", "video/msvideo", "video/x-msvideo"},
         "AVI video.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_video"},
        {"general.mpeg",
         {"general.video"},
         {".mpg", ".mpeg", ".m75", ".m15"},
         {"video/mpg", "video/mpeg", "video/x-mpg", "video/x-mpeg"},
         "MPEG-1 or MPEG-2 video.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_video"},
        {"general.mpeg-4",
         {"general.video"},
         {".mp4"},
         {"video/mp4", "video/mp4v"},
         "MPEG-4 video.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_video"},
        {"general.3gpp",
         {"general.video"},
         {".3gp", ".3gpp"},
         {"video/3gpp"},
         "3GPP video.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_video"},
        {"general.3gpp2",
         {"general.video"},
         {".3g2", ".3gp2"},
         {"video/3gpp2"},
         "3GPP2 video.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_video"},
        {"general.audio",
         {"general.media"},
         {},
         {},
         "Base type for audio.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_audio"},
        {"general.ogg",
         {"general.audio"},
         {".ogg"},
         {"audio/ogg"},
         "OGG audio.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_audio"},
        {"general.aiff",
         {"general.audio"},
         {".aiff"},
         {"audio/aiff"},
         "AIFF audio.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_audio"},
        {"general.pcm",
         {"general.audio"},
         {".pcm"},
         {"audio/pcm"},
         "PCM audio.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_audio"},
        {"general.flac",
         {"general.audio"},
         {".flac"},
         {"audio/flac"},
         "FLAC audio.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_flac"},
        {"general.alac",
         {"general.audio"},
         {".alac"},
         {"audio/alac"},
         "ALAC audio.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_audio"},
        {"general.mp3",
         {"general.audio"},
         {".mp3"},
         {"audio/mp3"},
         "MPEG-3 audio.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_mp3"},
        {"general.aac",
         {"general.audio"},
         {".aac"},
         {"audio/aac"},
         "AAC audio.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_audio"},
        {"general.archive",
         {"general.object"},
         {},
         {},
         "Base type for an archive of files and directories.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_compress"},
        {"general.tar-archive",
         {"general.archive"},
         {".tar"},
         {"application/x-tar, application/tar"},
         "Tar archive.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_compress"},
        {"general.zip-archive",
         {"general.archive"},
         {".zip"},
         {"application/zip"},
         "Zip archive.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_zip"},
        {"general.disk-image",
         {"general.archive"},
         {},
         {},
         "Base type for items mountable as a volume.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_compress"},
        {"general.bz2-archive",
         {"general.archive"},
         {".bz2"},
         {"application/x-bzip2"},
         "BZip2 archive.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_compress"},
        {"general.text",
         {"general.object"},
         {},
         {},
         "Base type for all text.",
         REFERENCE_URL,
         ""},
        {"general.plain-text",
         {"general.text"},
         {".txt"},
         {"text/plain"},
         "Text of unspecified encoding, with no markup.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_txt"},
        {"general.html",
         {"general.text"},
         {".html", ".htm"},
         {"text/html"},
         "HTML text.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_html"},
        {"general.hyperlink",
         {"general.text"},
         {},
         {},
         "Hyperlink.",
         REFERENCE_URL,
         ""},
        {"general.xml",
         {"general.text"},
         {".xml"},
         {"text/xml"},
         "XML text.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_xml"},
        {"general.source-code",
         {"general.plain-text"},
         {},
         {},
         "Generic source code.",
         REFERENCE_URL,
         ""},
        {"general.script",
         {"general.source-code"},
         {},
         {},
         "Base type for scripting language source code.",
         REFERENCE_URL,
         ""},
        {"general.shell-script",
         {"general.script"},
         {".sh", ".command"},
         {},
         "Shell script.",
         REFERENCE_URL,
         ""},
        {"general.csh-script",
         {"general.shell-script"},
         {".csh"},
         {},
         "C-shell script.",
         REFERENCE_URL,
         ""},
        {"general.perl-script",
         {"general.shell-script"},
         {".pl", ".pm"},
         {"text/x-perl-script"},
         "Perl script.",
         REFERENCE_URL,
         ""},
        {"general.python-script",
         {"general.shell-script"},
         {".py"},
         {"text/x-python-script"},
         "Python script.",
         REFERENCE_URL,
         ""},
        {"general.ruby-script",
         {"general.shell-script"},
         {".rb", ".rbw"},
         {"text/ruby-script"},
         "Ruby script.",
         REFERENCE_URL,
         ""},
        {"general.php-script",
         {"general.shell-script"},
         {".php", ".php3", ".php4", ".ph3", ".ph4", ".phtml"},
         {"text/x-php-script, text/php, application/php"},
         "PHP script.",
         REFERENCE_URL,
         ""},
        {"general.type-script",
         {"general.source-code"},
         {".ts"},
         {},
         "TypeScript source code.",
         REFERENCE_URL,
         ""},
        {"general.java-script",
         {"general.source-code"},
         {".js", ".jscript", ".javascript"},
         {"text/javascript"},
         "JavaScript source code.",
         REFERENCE_URL,
         ""},
        {"general.c-source",
         {"general.source-code"},
         {".c"},
         {},
         "C source code.",
         REFERENCE_URL,
         ""},
        {"general.c-header",
         {"general.source-code"},
         {".h"},
         {},
         "C header file.",
         REFERENCE_URL,
         ""},
        {"general.c-plus-plus-source",
         {"general.source-code"},
         {".cp", ".cpp", ".c++", ".cc", ".cxx"},
         {},
         "C++ source code.",
         REFERENCE_URL,
         ""},
        {"general.c-plus-plus-header",
         {"general.source-code"},
         {".hpp", ".h++", ".hxx"},
         {},
         "C++ header file.",
         REFERENCE_URL,
         ""},
        {"general.java-source",
         {"general.source-code"},
         {".java", ".jav"},
         {},
         "Java source code.",
         REFERENCE_URL,
         ""},
        {"general.ebook",
         {"general.composite-object"},
         {},
         {},
         "Base type for ebook.",
         REFERENCE_URL,
         ""},
        {"general.epub",
         {"general.ebook"},
         {".epub"},
         {"application/epub+zip"},
         "Electronic publication (EPUB) format.",
         REFERENCE_URL,
         ""},
        {"general.navigation",
         {"general.object"},
         {},
         {},
         "Base type for navigation.",
         REFERENCE_URL,
         ""},
        {"general.location",
         {"general.navigation"},
         {},
         {},
         "Navigation location.",
         REFERENCE_URL,
         ""},
        {"general.database",
         {"general.object"},
         {},
         {},
         "Base type for databases.",
         REFERENCE_URL,
         ""},
        {"general.vcard",
         {"general.object"},
         {},
         {},
         "Base type for electronic business card.",
         REFERENCE_URL,
         ""},
        {"general.calendar",
         {"general.object"},
         {},
         {},
         "Base type for scheduled events.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_calendar"},
        {"general.message",
         {"general.object"},
         {},
         {},
         "Base type for messages.",
         REFERENCE_URL,
         ""},
        {"general.contact",
         {"general.object"},
         {},
         {},
         "Base type for contact information.",
         REFERENCE_URL,
         ""},
        {"com.microsoft.bmp",
         {"general.image"},
         {".bmp"},
         {},
         "Windows bitmap image.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_image"},
        {"com.microsoft.ico",
         {"general.image"},
         {".ico"},
         {},
         "Windows icon image.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_image"},
        {"com.microsoft.word.doc",
         {"general.composite-object"},
         {".doc"},
         {"application/msword"},
         "Microsoft Word data.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_doc"},
        {"com.microsoft.excel.xls",
         {"general.composite-object"},
         {".xls"},
         {"application/vnd.ms-excel"},
         "Microsoft Excel data.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_xls"},
        {"com.microsoft.powerpoint.ppt",
         {"general.composite-object"},
         {".ppt"},
         {"application/mspowerpoint"},
         "Microsoft PowerPoint presentation.",
         REFERENCE_URL,
         ""},
        {"com.microsoft.waveform-audio",
         {"general.audio"},
         {".wav", ".wave"},
         {"audio/wav", "audio/wave"},
         "Waveform audio.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_wav"},
        {"com.microsoft.windows-media-wm",
         {"general.video"},
         {".wm"},
         {"video/x-ms-wm"},
         "Windows WM video.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_video"},
        {"com.microsoft.windows-media-wmv",
         {"general.video"},
         {".wmv"},
         {"video/x-ms-wmv"},
         "Windows WMV video.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_video"},
        {"com.microsoft.windows-media-wmp",
         {"general.video"},
         {".wmp"},
         {"video/x-ms-wmp"},
         "Windows WMP video.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_video"},
        {"com.microsoft.windows-media-wma",
         {"general.audio"},
         {".wma"},
         {"audio/x-ms-wma"},
         "Windows WMA audio.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_wma"},
        {"com.microsoft.windows-media-wmx",
         {"general.video"},
         {".wmx"},
         {"video/x-ms-wmx"},
         "Windows WMX video.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_video"},
        {"com.microsoft.windows-media-wvx",
         {"general.video"},
         {".wvx"},
         {"video/x-ms-wvx"},
         "Windows WVX video.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_video"},
        {"com.microsoft.windows-media-wax",
         {"general.audio"},
         {".wax"},
         {"audio/x-ms-wax"},
         "Windows WAX audio.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_audio"},
        {"com.adobe.pdf",
         {"general.composite-object"},
         {".pdf"},
         {"application/pdf"},
         "PDF data.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_pdf"},
        {"com.adobe.postscript",
         {"general.composite-object"},
         {".ps"},
         {"application/postscript"},
         "PostScript data.",
         REFERENCE_URL,
         ""},
        {"com.adobe.encapsulated-postscript",
         {"com.adobe.postscript"},
         {".eps"},
         {},
         "Encapsulated PostScript.",
         REFERENCE_URL,
         ""},
        {"com.adobe.photoshop-image",
         {"general.image"},
         {".psd"},
         {"image/x-photoshop", "image/photoshop", "image/psd", "application/photoshop"},
         "Adobe Photoshop document.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_image"},
        {"com.adobe.illustrator.ai-image",
         {"general.image"},
         {".ai"},
         {},
         "Adobe Illustrator document.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_image"},
        {"com.sun.java-archive",
         {"general.archive"},
         {".jar"},
         {"application/java-archive"},
         "Java archive.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_compress"},
        {"org.gnu.gnu-tar-archive",
         {"general.archive"},
         {".gtar"},
         {"application/x-gtar"},
         "GNU archive.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_compress"},
        {"org.gnu.gnu-zip-archive",
         {"general.archive"},
         {".gz", ".gzip"},
         {"application/x-gzip", "application/gzip"},
         "Gzip archive.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_compress"},
        {"org.gnu.gnu-zip-tar-archive",
         {"general.archive"},
         {".tgz"},
         {},
         "Gzip tar archive.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_compress"},
        {"com.amazon.azw",
         {"general.ebook"},
         {".azw"},
         {"application/vnd.amazon.ebook"},
         "AZW ebook.",
         REFERENCE_URL,
         ""},
        {"com.amazon.azw3",
         {"general.ebook"},
         {".azw3"},
         {"application/vnd.amazon.mobi8-ebook", "application/x-mobi8-ebook"},
         "AZW3 ebook.",
         REFERENCE_URL,
         ""},
        {"com.amazon.kfx",
         {"general.ebook"},
         {".kfx"},
         {},
         "KFX ebook.",
         REFERENCE_URL,
         ""},
        {"com.amazon.mobi",
         {"general.ebook"},
         {".mobi"},
         {"application/x-mobipocket-ebook"},
         "MOBI ebook.",
         REFERENCE_URL,
         ""},
        {"openharmony.form",
         {"general.object"},
         {},
         {},
         "OpenHarmony system defined form.",
         REFERENCE_URL,
         ""},
        {"openharmony.app-item",
         {"general.object"},
         {},
         {},
         "OpenHarmony system defined app item.",
         REFERENCE_URL,
         ""},
        {"openharmony.pixel-map",
         {"general.image"},
         {},
         {},
         "OpenHarmony system defined pixel map.",
         REFERENCE_URL,
         "sys.media.ohos_ic_normal_white_grid_image"},
        {"openharmony.atomic-service",
         {"general.object"},
         {},
         {},
         "OpenHarmony system defined atomic service.",
         REFERENCE_URL,
         ""},
        {"openharmony.package",
         {"general.directory"},
         {},
         {},
         "OpenHarmony system defined package (that is, a directory presented to the user as a file).",
         REFERENCE_URL,
         ""},
        {"openharmony.hap",
         {"openharmony.package"},
         {".hap"},
         {},
         "OpenHarmony system defined ability package.",
         REFERENCE_URL,
         ""}
    };
}
} // namespace UDMF
} // namespace OHOS
